package com.dalin.platform.loa.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.dalin.common.base.BaseObject;
/*****************************************************************************
 * @content: 系统项目类信息                                                                                                                    *
 * @author : 那建林                                                                                                                                 *
 * @crtDate: 2010-05-11                                                     *
 * @modDate: 2010-05-11                                                     *
 * @version: 1.00                                                           *
 ****************************************************************************/
@Entity
@Table(name="LOA_PROJECT")
public class LoaProjectEntity extends BaseObject {
    private Long projectId; // PROJECT_ID,16,0
    private String projectCode; // PROJECT_CODE,128,0
    private String projectName; // PROJECT_NAME,128,0
    private String projectDescription; // PROJECT_DESCRIPTION,512,0
    private Date createDate; // CREATE_DATE,7,0
    private Date modifyDate; // MODIFY_DATE,7,0
    private Integer valid; // VALID,2,0





    @Id
    @Column(name="PROJECT_ID")
    @GeneratedValue(strategy = GenerationType.TABLE,generator="generator_normal")
    @TableGenerator(
        name = "generator_normal",
        table = "GLB_GENERATOR_KEY",
        pkColumnName = "GEN_KEY",
        valueColumnName = "GEN_VALUE",
        pkColumnValue = "LOA_PROJECT",
        allocationSize=1
    )
    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    @Column(name="PROJECT_CODE")
    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    @Column(name="PROJECT_NAME")
    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    @Column(name="PROJECT_DESCRIPTION")
    public String getProjectDescription() {
        return projectDescription;
    }

    public void setProjectDescription(String projectDescription) {
        this.projectDescription = projectDescription;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="CREATE_DATE")
    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="MODIFY_DATE")
    public Date getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
    }

    @Column(name="VALID")
    public Integer getValid() {
        return valid;
    }

    public void setValid(Integer valid) {
        this.valid = valid;
    }

    @Override
    public int hashCode() {
        int njlrst = 17;
        njlrst = 31 * njlrst + (projectId == null ? 0 : projectId.hashCode());
        njlrst = 31 * njlrst + (projectCode == null ? 0 : projectCode.hashCode());
        njlrst = 31 * njlrst + (projectName == null ? 0 : projectName.hashCode());
        njlrst = 31 * njlrst + (projectDescription == null ? 0 : projectDescription.hashCode());
        njlrst = 31 * njlrst + (createDate == null ? 0 : createDate.hashCode());
        njlrst = 31 * njlrst + (modifyDate == null ? 0 : modifyDate.hashCode());
        njlrst = 31 * njlrst + (valid == null ? 0 : valid.hashCode());
        return njlrst;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof LoaProjectEntity)) return false;
        final LoaProjectEntity other = (LoaProjectEntity) o;
        if (projectId == null) {
            if (other.projectId != null) return false;
        } else if (!projectId.equals(other.projectId)) {
            return false;
        }
        if (projectCode == null) {
            if (other.projectCode != null) return false;
        } else if (!projectCode.equals(other.projectCode)) {
            return false;
        }
        if (projectName == null) {
            if (other.projectName != null) return false;
        } else if (!projectName.equals(other.projectName)) {
            return false;
        }
        if (projectDescription == null) {
            if (other.projectDescription != null) return false;
        } else if (!projectDescription.equals(other.projectDescription)) {
            return false;
        }
        if (createDate == null) {
            if (other.createDate != null) return false;
        } else if (!createDate.equals(other.createDate)) {
            return false;
        }
        if (modifyDate == null) {
            if (other.modifyDate != null) return false;
        } else if (!modifyDate.equals(other.modifyDate)) {
            return false;
        }
        if (valid == null) {
            if (other.valid != null) return false;
        } else if (!valid.equals(other.valid)) {
            return false;
        }
        return true;
    }



}
